const express = require('express')
const bodyParser = require('body-parser')

const app = express()

// const jsonParser = bodyParser.json()

const urlencodedParser = bodyParser.urlencoded({ extended: false })

app.get('/login', (req, res) => {
  res.sendFile(__dirname + '/11-form.html')
})
app.post('/login', urlencodedParser, (req, res) => {
  console.log(req.body)
  res.send('获取用户数据')
})

app.listen(3000, () => {
  console.log('server is running...')
})
